// --------------------------------------------------------------------------------------------------------------------

// <copyright file="AssertionConditionAttribute.cs" company="Social Development Spb">

//   Copyright (c) Social Development Spb 2009

// </copyright>

// <summary>

//   Indicates the condition parameter of the assertion method.

//   The method itself should be marked by <see cref="AssertionMethodAttribute" /> attribute.

//   The mandatory argument of the attribute is the assertion type.

// </summary>

// --------------------------------------------------------------------------------------------------------------------


using System;

namespace Diagnostics.Annotations
{
    #region Imported Namespaces

    

    #endregion


    /// <summary>
    /// Indicates the condition parameter of the assertion method. 
    /// The method itself should be marked by <see cref="AssertionMethodAttribute"/> attribute.
    /// The mandatory argument of the attribute is the assertion type.
    /// </summary>
    /// <seealso cref="AssertionConditionType"/>
    [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
    public sealed class AssertionConditionAttribute : Attribute
    {
        #region Constants and Fields

        private readonly AssertionConditionType _conditionType;

        #endregion


        #region Constructors and Destructors


        /// <summary>
        /// Initializes a new instance of the <see cref="AssertionConditionAttribute"/> class.
        /// </summary>
        /// <param name="conditionType">Type of the condition.</param>
        public AssertionConditionAttribute(AssertionConditionType conditionType)
        {
            _conditionType = conditionType;
        }

        #endregion


        #region Properties

        /// <summary>
        /// Gets condition type.
        /// </summary>
        /// <value>The type of the condition.</value>
        public AssertionConditionType ConditionType
        {
            get
            {
                return _conditionType;
            }
        }

        #endregion
    }
}